// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.randomizedWorld.randomizedDeadSurvivor;

import zombie.core.Rand;
import zombie.iso.BuildingDef;
import zombie.iso.IsoGridSquare;
import zombie.iso.objects.IsoDeadBody;

public final class RDSGunslinger extends RandomizedDeadSurvivorBase {
    @Override
    public void randomizeDeadSurvivor(BuildingDef def) {
        IsoGridSquare isoGridSquare = def.getFreeSquareInRoom();
        if (isoGridSquare != null) {
            IsoDeadBody isoDeadBody = RandomizedDeadSurvivorBase.createRandomDeadBody(isoGridSquare.getX(), isoGridSquare.getY(), isoGridSquare.getZ(), null, 0);
            if (isoDeadBody != null) {
                isoDeadBody.setPrimaryHandItem(super.addRandomRangedWeapon(isoDeadBody.getContainer(), true, false, false));
                int int0 = Rand.Next(1, 4);

                for (int int1 = 0; int1 < int0; int1++) {
                    isoDeadBody.getContainer().AddItem(super.addRandomRangedWeapon(isoDeadBody.getContainer(), true, true, true));
                }
            }
        }
    }

    public RDSGunslinger() {
        this.name = "Gunslinger";
        this.setChance(5);
    }
}
